import { Module } from '@nestjs/common';
import { AdminuserService } from './adminuser.service';
import { AdminuserController } from './adminuser.controller';
import { JwtModule } from '@nestjs/jwt';
import { ConfigModule, ConfigService } from '@nestjs/config';

@Module({
  imports: [
    JwtModule.registerAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: (config: ConfigService) => {
        return {
          secret: config.get('TOKEN_SECRET'),
          signOptions: {
            expiresIn: '100d'
          }
        }
      }
    })
  ],
  controllers: [AdminuserController],
  providers: [AdminuserService]
})
export class AdminuserModule {}
